package work;
import java.util.Scanner;
public class Money  extends  User implements Se,Cun,Qu {
    private double YuE;
    private double QuKuan;
    private double CunKuan;
    Scanner scanner = new Scanner(System.in);


    public Money() {
        super("张三", 123456, 10000);
    }

    public Money(String name, int passWord, double money) {
        super(name, passWord, money);
    }

    @Override
    public void cun() {
        System.out.println("请输入要存的款数:");
        setCunKuan(scanner.nextDouble());
        setMoney(getMoney() + getCunKuan());
        System.out.println("你的当前余额为:" + getMoney());
    }

    @Override
    public void Qu() {
        System.out.println("请输入要取的款数:");
        setQuKuan(scanner.nextDouble());
        if (getQuKuan() < getMoney()) {
            setMoney(getMoney() - getQuKuan());
            System.out.println("你的当前余额为:" + getMoney());
        } else {
            System.out.println("余额不足!");
        }
}

    @Override
    public void se() {
        System.out.println("你的余额为:" + getMoney());
    }


    public double getYuE() {
        return YuE;
    }

    public void setYuE(double yuE) {
        YuE = yuE;
    }

    public double getQuKuan() {
        return QuKuan;
    }

    public void setQuKuan(double quKuan) {
        QuKuan = quKuan;
    }

    public double getCunKuan() {
        return CunKuan;
    }

    public void setCunKuan(double cunKuan) {
        CunKuan = cunKuan;
    }

}

